import React, { useContext } from 'react'
import Item from './Item'

//先把提供值的这个context对象引入
import { App1Context } from '../../App'
import { App2Context } from '../../App'

export default function List() {
  //可以使用useContext Hook方法接受某个对象提供的数据
  // console.log(useContext(App1Context));
  const arr = useContext(App1Context)
  const count = useContext(App2Context)

  return (
    <div>
        <h1>我是儿子组件</h1>
        父组件的arr:{arr}
        <p>我用的父组件的count的值是{count}</p>
        <Item/>
    </div>
  )
}
